#!/bin/bash
/usr/bin/expect <<-END
spawn virsh edit $1
send ":%s/type=\'vnc\' port=\'-1\' autoport=\'yes\'/type=\'vnc\' port=\'$2\' autoport=\'no\'/g\r"
send ":wq\r"
expect eof
END
